package com.zrl.excel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.Map;

/**
 * @author: zrl
 * @date: 2022/8/13 18:08
 * @description:
 */
public class ExcelListener extends AnalysisEventListener<User> {

    //一行一行读取excel中的内容，把内容封装到user中
    //从第二行开始读
    @Override
    public void invoke(User  user, AnalysisContext analysisContext) {
        System.out.println(user);
    }

    //读取表头信息
    @Override
    public void invokeHeadMap(Map headMap, AnalysisContext context) {
        System.out.println("表头:"+headMap);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }

}
